package com.gaohe.service.Impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gaohe.mapper.ShopMapper;
import com.gaohe.pojo.Shop;
import com.gaohe.service.ShopService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ShopServiceImpl extends ServiceImpl<ShopMapper, Shop>
        implements ShopService {
    @Autowired
    private ShopMapper shopMapper;
    @Override
    public PageInfo<Shop> pageList(Integer page, Integer pageSize, String name) {
        PageHelper.startPage(page,pageSize);
        List<Shop> shopList = shopMapper.getAll(name);
        PageInfo<Shop> shopPageInfo = new PageInfo<>(shopList);
        return shopPageInfo;
    }
}
